using JGSY.CMS.LowCode.Platform.Domain.Entities;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace JGSY.CMS.LowCode.Platform.Domain.Interfaces
{
    /// <summary>
    /// 双重认证仓储接口
    /// 提供用户双重认证信息的数据访问操作，支持两步验证和安全认证管理功能
    /// </summary>
    public interface ITwoFactorRepository
    {
        /// <summary>
        /// 获取所有双重认证记录
        /// </summary>
        /// <returns>双重认证实体列表</returns>
        Task<IEnumerable<TwoFactor>> GetAllAsync();
        
        /// <summary>
        /// 根据ID获取双重认证记录
        /// </summary>
        /// <param name="id">双重认证记录标识符</param>
        /// <returns>双重认证实体，如果未找到则返回null</returns>
        Task<TwoFactor?> GetByIdAsync(long id);
        
        /// <summary>
        /// 根据用户ID获取双重认证记录
        /// </summary>
        /// <param name="userId">用户标识符</param>
        /// <returns>用户的双重认证实体，如果未找到则返回null</returns>
        Task<TwoFactor?> GetByUserIdAsync(long userId);
        
        /// <summary>
        /// 添加新的双重认证记录
        /// </summary>
        /// <param name="entity">要添加的双重认证实体</param>
        /// <returns>添加操作任务</returns>
        Task AddAsync(TwoFactor entity);
        
        /// <summary>
        /// 更新双重认证记录
        /// </summary>
        /// <param name="id">双重认证记录标识符</param>
        /// <param name="entity">更新后的双重认证实体</param>
        /// <returns>更新操作任务</returns>
        Task UpdateAsync(long id, TwoFactor entity);
        
        /// <summary>
        /// 删除双重认证记录
        /// </summary>
        /// <param name="id">双重认证记录标识符</param>
        /// <returns>删除操作任务</returns>
        Task DeleteAsync(long id);
    }
}
